import request from '@/utils/request'

//用户登录
export const login = function (data) {
  return request.post('/user/login', data)
}
//用户注册
export const register = data => {
  return request.post('/user/registered', data)
}
//添加到收藏
export const addFavorites = id => {
  return request.post(`/user/favorites/${id}`)
}
//删除收藏
export const delFavorites = id => {
  return request.delete(`/user/favorites/${id}`)
}
//查看收藏列表
export const checkFavorites = () => {
  return request.get(`/user/favorites`)
}
//是否已收藏
export const isFavorites = id => {
  return request.get(`/user/favorites/${id}`)
}
//查看已发布的房源列表
export const checkHouses = () => {
  return request.get(`/user/houses`)
}
//发布房源
export const releaseHouses = body => {
  return request.post(`/user/houses`, body)
}
